<?
  if(!admin_isadmin())die();

//__ METHOD ____________________________________________
    $_action=$_GET['_action'];

    if ($_action=="lockadmin"){
	admin_writelog("vwiki:lockadmin");
	chmod("datas/applications/".apptitle($appname)."/admin.flag",0444);
    }
    if ($_action=="unlockadmin"){
	admin_writelog("vwiki:unlockadmin");
	chmod("datas/applications/".apptitle($appname)."/admin.flag",0666);
    }
//__ INTERFACE ________________________________________

    echo"<font size=6><b>ADMIN LOCK</b></font><br />\n";

    if (is_writable("datas/applications/".apptitle($appname)."/admin.flag"))
	echo "<a href=\"index.php?appname=$appname&action=admin&_action=lockadmin\">admin button unlocked</a>";
    else
	echo "<a href=\"index.php?&appname=$appname&action=admin&_action=unlockadmin\">admin button locked</a>";
    echo "<hr>\n";
?>
